<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ include file="/views/commons/taglibs.jsp" %>
<div class="panel-heading">
	<div class="pull-right">
		<a href="<%=path %>/admin/coupon/toCreate" target="_blank">批量生成券码</a>
	</div>
	<h3 class="panel-title">券码列表</h3>
</div>
<div class="bd clearfix">
	<form id="admin_coupon_choose_form" action="javascript:void(0);">
		<div class="filter-wrap">
			<dl class="clearfix invest-filter">
				<dt>券码名称</dt>
				<dd class="clearfix">
					<div class="col-sm-4 mb20">
						<div class="input-group">
							<input type="text" name="couponName" value="${paramMap.couponName}" class="form-control" placeholder="请输入券码名称">
							<span class="input-group-btn">
								<button class="btn btn-primary" type="button" onclick="javascript:queryAdminCouponList(1);">搜索</button>
							</span>
						</div>
					</div>
				</dd>
				<dt>券码批次号</dt>
				<dd class="clearfix">
					<div class="col-sm-4 mb20">
						<div class="input-group">
							<input type="text" name="couponBatch" value="${paramMap.couponBatch}" class="form-control" placeholder="请输入券码批次号">
						</div>
					</div>
				</dd>
			</dl>
		</div>
	</form>
</div>
<c:choose>
<c:when test="${!empty dataList && fn:length(dataList) ne 0}">
<table class="table">
	<thead>
		<tr>
			<th width="30%">券码名称</th>
			<th width="10%">券码批次号</th>
			<th width="20%">券码类型</th>
			<th width="10%">加收邮费</th>
			<th width="10%">数量</th>
			<th width="10%">操作</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach var="coupon" items="${dataList}" varStatus="index">
		<tr>
			<td class="title">
				${coupon.couponName}
			</td>
			<td>${coupon.couponBatch}</td>
			<td>
			<c:if test="${coupon.applicationScope==1}">全品类</c:if>
			<c:if test="${coupon.applicationScope==2}">单品类：</c:if>
			${coupon.applicationGoodsName}			
			</td>
			<td>${coupon.extraFee}</td>
			<td>${coupon.couponNum}</td>
			<td>
				<a href="<%=path %>/admin/coupon/export?couponName=${coupon.couponName}&couponBatch=${coupon.couponBatch}" target="_blank">导出</a>
			</td>
		</tr>
		</c:forEach>
	</tbody>
</table>
<!-- 分页 -->
<p:pagination pageNo="${paramMap.pageNo}" pageCount="${paramMap.pageCount}" queryFunction="queryAdminCouponList" style="text-center"></p:pagination>
<!-- 分页 end -->
</c:when>
<c:otherwise>
	<table class="table">
		<thead>
			<tr>
				<th>商品名称</th>
				<th>商品原价</th>
				<th>运费</th>
				<th>可选属性</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td colspan="3" align="center">
					暂无数据
				</td>
			</tr>
		</tbody>
	</table>
</c:otherwise>
</c:choose>